package com.xuelang.pipeline.domain.pipeline.service.imp;

import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.pipeline.dto.PipelineTagQuery;
import com.xuelang.pipeline.domain.pipeline.PipelineTag;
import com.xuelang.pipeline.domain.pipeline.repository.PipelineTagRepository;
import com.xuelang.pipeline.domain.pipeline.service.PipelineTagDomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 流水线标签领域服务实现类
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Service
public class PipelineTagDomainServiceImpl implements PipelineTagDomainService {

    @Autowired
    private PipelineTagRepository pipelineTagRepository;

    @Override
    public PageRecord<PipelineTag> pageList(long currentPage, long pageSize, PipelineTag pipelineTag) {
        return pipelineTagRepository.pageList(currentPage, pageSize, pipelineTag);
    }

    @Override
    public List<PipelineTag> list(PipelineTag pipelineTag) {
        return pipelineTagRepository.list(pipelineTag);
    }


    @Override
    public Boolean save(PipelineTag pipelineTag) {
        return pipelineTagRepository.save(pipelineTag);
    }

    @Override
    public Boolean update(PipelineTag pipelineTag) {
        return pipelineTagRepository.update(pipelineTag);
    }

    @Override
    public Boolean delete(String uuid) {
        return pipelineTagRepository.delete(uuid);
    }

    @Override
    public PipelineTag query(String uuid) {
        return pipelineTagRepository.query(uuid);
    }

    @Override
    public List<PipelineTag> queryByPipelineCode(String pipelineCode) {
        return pipelineTagRepository.queryByPipelineCode(pipelineCode);
    }

    @Override
    public Boolean deleteByPipelineCode(String pipelineCode) {
        return pipelineTagRepository.deleteByPipelineCode(pipelineCode);
    }

    @Override
    public Boolean modifyPipelineTags(PipelineTagQuery query, String creatorId) {
        return pipelineTagRepository.modifyPipelineTags(query, creatorId);
    }
}
